package cn.aitrox.ry.service.config.dto.tool.result.struct.rectangle;

import cn.aitrox.ry.service.config.dto.tool.result.struct.PointStruct;
import cn.aitrox.ry.service.config.dto.tool.result.struct.ToolBasicStruct;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@NoArgsConstructor
public class RectangleStruct extends ToolBasicStruct<RectangleDataStruct> {

    public RectangleStruct(RectangleDataStruct data, String version) {
        super(data, version);
    }

    public static RectangleStruct createV1(List<Double> coords, Integer z) {
        PointStruct point1 = new PointStruct(coords.get(0), coords.get(1), z);
        PointStruct point2 = new PointStruct(coords.get(2), coords.get(3), z);
        RectangleDataStruct data = new RectangleDataStruct(point1, point2);
        return new RectangleStruct(data, "1.0");
    }


}
